//============================================================================
// Name        : ShowUnregisteredCourses.cpp
// Author      : Sartios
// Version     :
// Copyright   : (C) Savramis Sartios
// Description : Hello World in C++, Ansi-style
//============================================================================


#include <iostream>
/*
//#include "Domain/TitleList/Iterator/TitleIterator.h"
//#include "Controllers/CourseTitleListCreator/CourseTitleListCreator.h"
//#include "Domain/CourseTeachersList/List/CourseTeachersList.h"
//#include "Domain/CourseTeachersList/Iterator/ICourseTeachersIterator.h"
//#include "Controllers/CourseTeachersListCreator/CourseTeachersListCreator.h"
*/

//#include "Domain/TeacherNameList/List/TeacherNameList.h"
#include "Controllers/TeacherNameListCreator/TeacherNameListCreator.h"

using namespace std;

int main() {
	/*//ICodeList	*list	=	new CodeList;
	ICodeIterator	*it;	=	new CodeListIterator
	string		*code	=	new string;
	CourseCodeListCreator *creator = new CourseCodeListCreator;

	vector<string*>	*list = new vector<string*>;


	for(int i=0;i<3;i++){
		cout<<"\nEnter course code : ";
		cin>>*code;
		list->push_back(new string(*code));
	}

	it=creator->getCourseCodes(list);

	for(it->first();!(it->isDone());it->next()){
		cout<<"\n"<<*it->getCurrent();
	}

	for(int i=0;i<list->size();i++){
		delete list->at(i);
	}

	delete list;
	delete it;
	delete code;
	delete creator;*/
//==========================================================================================
	//ITitleListManager 	*manager=new TitleListManager;
	/*CourseTitleListCreator *creator =new CourseTitleListCreator;
	ITitleListIterator 	*it;
	string	*code=new string;
	string	*title=new string;
	map<string*,string*> *courses=new map<string*,string*>;

		for(int i=0;i<5;i++){
			cout<<"\nEnter code : ";
			cin>>*code;
			cout<<"\nEnter title : ";
			cin>>*title;
			courses->insert(pair<string*,string*>(new string(*code),new string(*title)));
		}


		it=creator->getCourseTitles(courses);
		for(it->first();!it->isDone();it->next()){
			//cout<<*it->getValue(code);
			cout<<*(it->getCurrent())<<endl;
			delete (it->getCurrent());
		}

		delete code;
		delete title;
		delete creator;
		delete it;
		delete courses;*/
//==============================================================================================
/*
	//ICourseTeachersList		*list = new CourseTeachersList;
	//ICourseTeachersIterator   *it;

	ICourseTeachersIterator		*it;
	CourseTeachersListCreator 	*creator = new CourseTeachersListCreator;

	map<string*,vector<string *>*> *teachers=new map<string*,vector<string *>*>;
	vector<string *> 		*courses = new vector<string *>;

	string	*courseCode = new string;
	string	*teacherCode = new string;


	for(int i=0;i<1;i++){
		cout<<"\nCourse code : ";
		cin>>*courseCode;

		for(int j=0;j<3;j++){
			cout<<"\nTeacher code : ";
			cin>>*teacherCode;

			courses->push_back(teacherCode);
		}
		teachers->insert(pair<string*,vector<string *>*>(courseCode,courses));
	}

	it=creator->getTeachers(teachers);
	for(it->first();!it->isDone();it->next()){

		while(!it->teacherIsLast()){
			cout<<"\nTeacher : "<<*(it->getTeacher());
		}

	}

	delete it;
	delete creator;
	delete courses;
	delete teachers;
	delete courseCode;
	delete teacherCode;*/

	//ITeacherNameList *list = new TeacherNameList;

	map<string*,string*> *teachers = new map<string*,string*>;

	TeacherNameListCreator *creator = new TeacherNameListCreator;
	ITeacherNameIterator *it;

	string *code=new string;
	string *name=new string;

	for(int i=0;i<1;i++){

		cout<<"\nCode : ";
		cin>>*code;
		cout<<"\nName : ";
		cin>>*name;

		teachers->insert(pair<string*,string*>(code,name));
	}

	it = creator->getTeachersName(teachers);

	for(it->first();!it->isDone();it->next()){

		code = it->getCurrentTeacherCode();
		cout<<"\nCode : "<<*code;

		string * name = it->getTeacherName(code);
		cout<<"\nName : "<<*name;
	}

	delete code;
	delete name;
	delete it;
	delete teachers;
	delete creator;
}
